package com.atlin.project.model.vo.sysUser;

import com.atlin.project.model.domain.SysUser;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户登录结果
 *
 * @TableName user
 */
@Data
public class SysUserLoginResult extends SysUser implements Serializable {

    /**
     * 用户昵称
     */
    private String userToken;

    public static SysUserLoginResult getSysUserLoginResult(SysUser sysUser, String userToken) {
        if (sysUser == null || StringUtils.isBlank(userToken)) {
            return null;
        }
        SysUserLoginResult sysUserLoginResult = new SysUserLoginResult();
        BeanUtils.copyProperties(sysUser, sysUserLoginResult);
        sysUserLoginResult.setUserToken(userToken);
        return sysUserLoginResult;
    }

    private static final long serialVersionUID = 1L;
}